package TestClasses;



import java.util.ArrayList;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import ModelLayer.*;
import DBLayer.*;

public class DBCustomerTest {
	
	DBCustomer dbc = new DBCustomer();

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testGetAllCustomers() {
		ArrayList<Customer> cus = dbc.getAllCustomers(false);
	    System.out.println(cus.size());
	}

	@Test
	public void testFindCustomer() {
		Customer cus = dbc.findCustomer(1);
		System.out.println(cus.getName());
	}

	@Test
	public void testSearchCustomerName() {
		Customer cus = dbc.searchCustomerName("John");
		System.out.println(cus.getName() + " " + cus.getAddress());
	}

	@Test
	public void testSearchCustomerId() {
		Customer cus = dbc.searchCustomerId("2");
		System.out.println(cus.getName() + " " + cus.getAddress());
	}

	/*@Test
	public void testInsertCustomer() throws Exception{
		Customer cusObj = new Customer(7, "Patrice Vermuhren", "Onsild Byvej 4", "DK-6000", "Kolding", "66774488", "patrice@elveren.dk", "Private");
		dbc.insertCustomer(cusObj);
	}*/

/*	@Test
	public void testUpdateCustomer() throws Exception{
		Customer cusObj = new Customer(5, "Patrice Hansen", "Onsild Byvej 4", "DK-6000", "Kolding", "66774488", "patrice@elveren.dk", "Private");
		dbc.updateCustomer(cusObj);
	}*/

/*	@Test
	public void testDeleteCustomer() {
		dbc.deleteCustomer(5);
		ArrayList<Customer> customers = dbc.getAllCustomers(false);
		System.out.println(customers.size());
	}
*/
}
